﻿Imports Aras.IOM
Imports System.Xml


Partial Class GetDocuments
    Inherits System.Web.UI.Page

    Dim Dossier_id As String = ""



    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


    End Sub


    Public Function RecupProjects() As String

        Dim resultat As String

        'récupération dossiers

        If Session("ConnecState") = True Then
            Dim connec As ConnecteurAras = New ConnecteurAras(Session("LOGON_NAME"), Session("LOGON_PASS"))
            resultat = connec.getProjects(connec.IdentityID)

            connec.logActivity("information", "Récupération des projets", "Résultat: " + resultat)
        Else
            resultat = "Erreur Login"
        End If

        Return resultat
        

    End Function

    Public Function GedLogin(ByVal loginname As String, ByVal password As String) As String
        Dim result As String = "False"

        Dim conn As ConnecteurAras = New ConnecteurAras(loginname, password)
        Session("LOGON_PASS") = password
        Session("LOGON_NAME") = loginname

        If conn.state = True Then
            result = "Ok"
            Session("ConnecState") = True
        Else
            result = "False"
            Session("ConnecState") = False
        End If


        Return Result
    End Function
End Class
